from fastapi import FastAPI
from .JWT import JwtMiddleware
from starlette.middleware.gzip import GZipMiddleware


def registerMiddlewareHandle(server: FastAPI):
    # server.add_middleware(GZipMiddleware, minimum_size=1000)  # 设置最小压缩阈值，例如1000字节

    server.add_middleware(JwtMiddleware)    # 添加耗时请求中间件